Skip to content

Include slow tests in local coverage#299

Closed
cking100 wants to merge 1 commit intoopenzim:mainfrom
cking100:increase-coverage
Closed

Include slow tests in local coverage#299
cking100 wants to merge 1 commit intoopenzim:mainfrom
cking100:increase-coverage

Conversation

@cking100
Copy link
Copy Markdown
Contributor

Fixes #293

The coverage shown was incorrect when running invoke coverage locally, as the slow tests were skipped. Adding --runslow flag ensures slow tests run properly before reporting coverage locally.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (1fdc823) to head (c685680).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #299   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          41       41           
  Lines        2545     2545           
  Branches      365      365           
=======================================
  Hits         2538     2538           
  Misses          2        2           
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@benoit74 benoit74 self-requested a review April 28, 2026 06:26
Copy link
Copy Markdown
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is the right fix at all for two reasons.

First CI already runs with --runslow --runinstalled flags

image

But coverage is still "only" at 99% in https://github.com/openzim/python-scraperlib/actions/runs/24666505316/job/72125521954 (last CI run on main branch):

image

This 99% is the problem which needs to be fixed.

And we intentionally do not set flags in the invoke tasks so that users can choose to run with or without them. If we include the flags in invoke tasks, then there is no way to not run slow tests for instance.

Do I miss something or should we close this PR?

@cking100
Copy link
Copy Markdown
Contributor Author

And we intentionally do not set flags in the invoke tasks so that users can choose to run with or without them. If we include the flags in invoke tasks, then there is no way to not run slow tests for instance.

My apologies. I misunderstood the problem. The contribution section said to run invoke coverage locally, which was skipping the slow tests and showing a partial coverage report. And you're right we shouldn't include flags in invoke tasks when we can just run invoke coverage --args="--runslow" to get a more accurate coverage report.

I will close this PR. Sorry for the inconvenience. @benoit74

@cking100 cking100 closed this Apr 28, 2026
@benoit74
Copy link
Copy Markdown
Collaborator

No problem, misunderstandings is expected and normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code coverage should be back to 100%

2 participants